<template>
  <div>
    <div>
      <p>ASE对称加密和解密</p>
      <a-button @click="add1">测试</a-button>
    </div>

    <div>
      <p>RSA 非对称加密</p>
      <a-button @click="add2">测试</a-button>
    </div>
  </div>
</template>
<script setup>
import { encrypt, decrypt, desEncrypt, desDecrypt } from "@/hooks/useCrypto.ts"
import { encryption, decryption } from "@/hooks/useJsencrypt.ts"

const add1 = () => {
  let pwd = "lianhai,123"
  console.log(encrypt(pwd))
  console.log(desEncrypt(pwd))

  console.log(decrypt(encrypt(pwd)))
  console.log(desDecrypt(desEncrypt(pwd)))
}

const add2 = () => {
  let pwd = "lianhai,123"
  console.log(encryption(pwd))
  console.log(decryption(encryption(pwd)))
}
</script>
